<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>登录</title>
<style type="text/css">
.title{font-family: verdana, tahoma, sans-serif;FONT-SIZE: 10px;font-weight:bold}
.grey{FONT-SIZE: 12px;color:#666666}

.orange {font-family: verdana, tahoma, sans-serif;font-size:10px;color:#FF6600}
.orange A:link {font-family: verdana, tahoma, sans-serif;font-size:10px;color:#FF6600;text-decoration:underline}
.orange A:visited {font-family: verdana, tahoma, sans-serif;font-size:10px;color:#FF6600;text-decoration:underline}
.orange A:hover {font-family: verdana, tahoma, sans-serif;font-size:10px;color:#FF6600;text-decoration:underline}
.orange A:active {font-family: verdana, tahoma, sans-serif;font-size:10px;color:#FF6600;text-decoration:underline}


textarea, input, select{
    background: #FFFFFF;
    border: 1px solid #CCCCCC;
    color: #000000;
    font-family: verdana, tahoma, sans-serif;
    font-size: 0.95em;}
.username{
    background-image:url(pages/img/username.gif);
	background-position: 1px 1px;
	background-repeat:no-repeat;
	padding-left:20px;
	height:20px;
	FONT-SIZE: 12px;}
.password{
    background-image:url(pages/img/password.gif);
	background-position: 1px 1px;
	background-repeat:no-repeat;
	padding-left:20px;
	height:20px;
	FONT-SIZE: 12px;}
</style>
</head>

<body>
<div style="height:200px;" ></div>
<div style="margin:auto;border:1px solid blue; padding:20px;width:250px;">
<form action="admin.php?r=index/login" method="post" onsubmit="return check();" >
<table width="208" border="0" align="center" cellpadding="5" cellspacing="0">
  <tr>
    <td bgcolor="#F4F4F4" class="title">用户登录</td>
  </tr>
  <tr>
    <td class="grey"><img src="pages/img/warning.gif" width="16" height="16" align="absmiddle"><span id="warn" style="color:red;" > <?php echo $info; ?></span></td>
  </tr>
  <tr>
    <td class="title">用户名</td>
  </tr>
  <tr>
    <td><input name="username" id="username" type="text" class="username" size="30"></td>
  </tr>
  <tr>
    <td></td>
  </tr>
  <tr>
    <td class="title">密码</td>
  </tr>
  <tr>
    <td><input name="password" id="password" type="password" class="password" size="30"></td>
  </tr>
  <tr>
    <td align="right"><input type="submit" name="submit" value=" 登录 " ></td>
  </tr>
</table>
</form>
</div>
<script type="text/javascript" src="pages/js/md5.js"></script>
<script type="text/javascript" src="//lib.sinaapp.com/js/jquery/2.0/jquery.min.js"></script>
<script type="text/javascript">
	function check(){
		var len1=document.getElementById('username').value.length;
		var len2=document.getElementById('password').value.length;
		if(len1 == 0) {
			$('#warn').html('用户名不能为空');
			return false;
		}
		if(len1 > 20){
            $('#warn').html('用户名过长');
            return false;
        }
		if(len2 == 0) {
            $('#warn').html('密码不能为空');
            return false;
        }
		if(len2 > 20) {
            $('#warn').html('密码长度过长');
            return false;
        }
		var md5_value=hex_md5(document.getElementById('password').value);
		document.getElementById('password').value=md5_value;
		return true;
	}	
</script>
</body>
</html>
